aarch64: Recognize SHT_AARCH64_ATTRIBUTES
authorMark Wielaard <mark@klomp.org>
Tue, 24 Feb 2026 21:19:48 +0000 (22:19 +0100)
committerMatthias Klose <doko@debian.org>
Tue, 17 Mar 2026 14:25:35 +0000 (15:25 +0100)
Recognize SHT_AARCH64_ATTRIBUTES. This is enough to stop elflint
complaining about unknown section types. But doesn't implement parsing
the attributes.

* backends/aarch64_symbol.c (aarch64_section_type_name):
  New function.
* backends/aarch64_init.c (aarch64_init): Hook
        section_type_name.

https://sourceware.org/bugzilla/show_bug.cgi?id=33923

Signed-off-by: Mark Wielaard <mark@klomp.org>
Gbp-Pq: Name pr33991.diff

backends/aarch64_init.c
backends/aarch64_symbol.c

index bed929548dcde18808fc9fae8c0255b893357988..c61767d56636235bf6f6123b2280c422a44ca042 100644 (file)
@@ -54,6 +54,7 @@ aarch64_init (Elf *elf __attribute__ ((unused)),
   HOOK (eh, dynamic_tag_check);
   HOOK (eh, data_marker_symbol);
   HOOK (eh, abi_cfi);
+  HOOK (eh, section_type_name);
 
   /* X0-X30 (31 regs) + SP + 1 Reserved + ELR, 30 Reserved regs (34-43)
      + V0-V31 (32 regs, least significant 64 bits only)
index 15e0805b7604ce937a458bf3aa7cca7dd8961751..af9322fda5613270ebac4353fe9c13646d0aa24f 100644 (file)
@@ -134,3 +134,21 @@ aarch64_dynamic_tag_check (int64_t tag)
          || tag == DT_AARCH64_PAC_PLT
          || tag == DT_AARCH64_VARIANT_PCS);
 }
+
+/* Return symbolic representation of section type.  */
+const char *
+aarch64_section_type_name (int type,
+                          char *buf __attribute__ ((unused)),
+                          size_t len __attribute__ ((unused)))
+{
+  switch (type)
+    {
+#ifndef SHT_AARCH64_ATTRIBUTES
+#define SHT_AARCH64_ATTRIBUTES 0x70000003
+#endif
+    case SHT_AARCH64_ATTRIBUTES:
+      return "AARCH64_ATTRIBUTES";
+    }
+
+  return NULL;
+}